<template>
    <view>
        <template v-for="(item, index) in AVEncEncodeList">
            <j-cell-group :key="index" :title="'通道' + index">
                <j-cell-card title="主码流" :show="false" :is-touch="false" border style="background: #f5f7fb">
                    <template v-for="(item, size) in item.MainFormat">
                        <j-cell-card :key="item.size" :title="size" :show="false" :is-touch="false" border style="background: #f5f7fb">
                            <j-cell-card title="音频配置" :show="false" :is-touch="false" border>
                                <j-cell title="音频" :more="false">
                                    <view slot="tips">
                                        <switch :checked="item.AudioEnable" disabled></switch>
                                    </view>
                                </j-cell>
                                <j-cell title="比特率" :tips="item.Audio.BitRate" :more="false"></j-cell>
                                <j-cell title="采样率" :tips="item.Audio.SampleRate" :more="false"></j-cell>
                                <j-cell title="最大音量" :tips="item.Audio.MaxVolume" :more="false"></j-cell>
                            </j-cell-card>
                            <j-cell-card title="视频配置" :show="false" :is-touch="false" border>
                                <j-cell title="视频" :more="false">
                                    <view slot="tips">
                                        <switch :checked="item.VideoEnable" disabled></switch>
                                    </view>
                                </j-cell>
                                <j-cell title="码流" :tips="item.Video.BitRate" :more="false"></j-cell>
                                <j-cell title="码流控制模式" :tips="item.Video.BitRateControl" :more="false"></j-cell>
                                <j-cell title="压缩格式" :tips="item.Video.Compression" :more="false"></j-cell>
                                <j-cell title="帧率" :tips="item.Video.FPS" :more="false"></j-cell>
                                <j-cell title="帧间隔" :tips="item.Video.GOP" :more="false"></j-cell>
                                <j-cell title="图像质量" :tips="item.Video.Quality" :more="false"></j-cell>
                                <j-cell title="分辨率" :tips="item.Video.Resolution" :more="false"></j-cell>
                                <j-cell title="虚拟图像" :tips="item.Video.VirtualGOP" :more="false"></j-cell>
                            </j-cell-card>
                        </j-cell-card>
                    </template>
                </j-cell-card>

                <j-cell-card title="辅码流" :show="false" :is-touch="false" border style="background: #f5f7fb">
                    <template v-for="(item, size) in item.ExtraFormat">
                        <j-cell-card :key="item.size" :title="size" :show="false" :is-touch="false" border style="background: #f5f7fb">
                            <j-cell-card title="音频配置" :show="false" :is-touch="false" border>
                                <j-cell title="音频" :more="false">
                                    <view slot="tips">
                                        <switch :checked="item.AudioEnable" disabled></switch>
                                    </view>
                                </j-cell>
                                <j-cell title="音频格式" :more="false"></j-cell>
                                <j-cell title="比特率" :tips="item.Audio.BitRate" :more="false"></j-cell>
                                <j-cell title="采样率" :tips="item.Audio.SampleRate" :more="false"></j-cell>
                                <j-cell title="最大音量" :tips="item.Audio.MaxVolume" :more="false"></j-cell>
                            </j-cell-card>
                            <j-cell-card title="视频配置" :show="false" :is-touch="false" border>
                                <j-cell title="视频" :more="false">
                                    <view slot="tips">
                                        <switch :checked="item.VideoEnable" disabled></switch>
                                    </view>
                                </j-cell>
                                <j-cell title="视频格式" :more="false"></j-cell>
                                <j-cell title="码流" :tips="item.Video.BitRate" :more="false"></j-cell>
                                <j-cell title="码流控制模式" :tips="item.Video.BitRateControl" :more="false"></j-cell>
                                <j-cell title="压缩格式" :tips="item.Video.Compression" :more="false"></j-cell>
                                <j-cell title="帧率" :tips="item.Video.FPS" :more="false"></j-cell>
                                <j-cell title="帧间隔" :tips="item.Video.GOP" :more="false"></j-cell>
                                <j-cell title="图像质量" :tips="item.Video.Quality" :more="false"></j-cell>
                                <j-cell title="分辨率" :tips="item.Video.Resolution" :more="false"></j-cell>
                                <j-cell title="虚拟图像" :tips="item.Video.VirtualGOP" :more="false"></j-cell>
                            </j-cell-card>
                        </j-cell-card>
                    </template>
                </j-cell-card>

                <j-cell-card title="抓图" :show="false" :is-touch="false" border style="background: #f5f7fb">
                    <template v-for="(item, size) in item.SnapFormat">
                        <j-cell-card :key="item.size" :title="size" :show="false" :is-touch="false" border style="background: #f5f7fb">
                            <j-cell-card title="音频配置" :show="false" :is-touch="false" border>
                                <j-cell title="音频" :more="false">
                                    <view slot="tips">
                                        <switch :checked="item.AudioEnable" disabled></switch>
                                    </view>
                                </j-cell>
                                <j-cell title="音频格式" :more="false"></j-cell>
                                <j-cell title="比特率" :tips="item.Audio.BitRate" :more="false"></j-cell>
                                <j-cell title="采样率" :tips="item.Audio.SampleRate" :more="false"></j-cell>
                                <j-cell title="最大音量" :tips="item.Audio.MaxVolume" :more="false"></j-cell>
                            </j-cell-card>
                            <j-cell-card title="视频配置" :show="false" :is-touch="false" border>
                                <j-cell title="视频" :more="false">
                                    <view slot="tips">
                                        <switch :checked="item.VideoEnable" disabled></switch>
                                    </view>
                                </j-cell>
                                <j-cell title="视频格式" :more="false"></j-cell>
                                <j-cell title="码流" :tips="item.Video.BitRate" :more="false"></j-cell>
                                <j-cell title="码流控制模式" :tips="item.Video.BitRateControl" :more="false"></j-cell>
                                <j-cell title="压缩格式" :tips="item.Video.Compression" :more="false"></j-cell>
                                <j-cell title="帧率" :tips="item.Video.FPS" :more="false"></j-cell>
                                <j-cell title="帧间隔" :tips="item.Video.GOP" :more="false"></j-cell>
                                <j-cell title="图像质量" :tips="item.Video.Quality" :more="false"></j-cell>
                                <j-cell title="分辨率" :tips="item.Video.Resolution" :more="false"></j-cell>
                                <j-cell title="虚拟图像" :tips="item.Video.VirtualGOP" :more="false"></j-cell>
                            </j-cell-card>
                        </j-cell-card>
                    </template>
                </j-cell-card>
            </j-cell-group>
        </template>
    </view>
</template>

<script>
export default {
    data() {
        return {
            token: '',
            AVEncEncodeList: [],
            size: ''
        };
    }
    /**
     * 生命周期函数--监听页面加载
     */,
    onLoad: function (options) {
        console.log(options);
		this.token = options.token
		this.getconfig();
    },
    /**
     * 生命周期函数--监听页面初次渲染完成
     */
    onReady: function () {},
    /**
     * 生命周期函数--监听页面显示
     */
    onShow: function () {},
    /**
     * 生命周期函数--监听页面隐藏
     */
    onHide: function () {},
    /**
     * 生命周期函数--监听页面卸载
     */
    onUnload: function () {},
    /**
     * 页面相关事件处理函数--监听用户下拉动作
     */
    onPullDownRefresh: function () {},
    /**
     * 页面上拉触底事件的处理函数
     */
    onReachBottom: function () {},
    /**
     * 用户点击右上角分享
     */
    onShareAppMessage: function () {},
    methods: {
        getconfig() {
            uni.showLoading();
            let token = this.token;
            let data = {
                Name: 'AVEnc.Encode'
            };
            getApp().globalData.api.getconfig(data, token, (result) => {
                console.log(result);
                uni.hideLoading({
                    success: (res) => {
                        this.AVEncEncodeList = result['AVEnc.Encode']
                    }
                });
            });
        }
    }
};
</script>
<style></style>
